<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>订单详情</title>
    <link rel="stylesheet" href="css/admin-order-detail.css">
    <link rel="stylesheet" href="css/admin-common.css">
</head>
<body>
<div class="admin-container">
    <div class="admin-sidebar">
        <!-- 侧边栏导航 -->
        <ul>
            <li><a href="dashboard.html">仪表盘</a></li>
            <li><a href="admin-orders.html">订单管理</a></li>
            <li><a href="products.html">商品管理</a></li>
            <li><a href="users.html">用户管理</a></li>
        </ul>
    </div>

    <div class="admin-content">
        <div class="admin-header">
            <h1>订单详情</h1>
            <a href="admin-orders.html" class="back-btn">返回列表</a>
        </div>

        <div class="order-detail">
            <div class="order-info">
                <h2>订单信息</h2>
                <div class="info-row">
                    <span>订单号:</span>
                    <span id="orderNo"></span>
                </div>
                <div class="info-row">
                    <span>用户ID:</span>
                    <span id="userId"></span>
                </div>
                <div class="info-row">
                    <span>订单状态:</span>
                    <span id="orderStatus"></span>
                </div>
                <div class="info-row">
                    <span>下单时间:</span>
                    <span id="createTime"></span>
                </div>
                <div class="info-row">
                    <span>支付时间:</span>
                    <span id="paymentTime"></span>
                </div>
                <div class="info-row">
                    <span>发货时间:</span>
                    <span id="shippingTime"></span>
                </div>
                <div class="info-row">
                    <span>完成时间:</span>
                    <span id="completeTime"></span>
                </div>
                <div class="info-row">
                    <span>订单金额:</span>
                    <span id="totalAmount"></span>
                </div>
                <div class="info-row">
                    <span>运费:</span>
                    <span id="freightAmount"></span>
                </div>
                <div class="info-row">
                    <span>实付金额:</span>
                    <span id="paymentAmount"></span>
                </div>
                <div class="info-row">
                    <span>订单备注:</span>
                    <span id="note"></span>
                </div>
            </div>

            <div class="shipping-info">
                <h2>收货信息</h2>
                <div class="info-row">
                    <span>收货人:</span>
                    <span id="receiverName"></span>
                </div>
                <div class="info-row">
                    <span>联系电话:</span>
                    <span id="receiverPhone"></span>
                </div>
                <div class="info-row">
                    <span>收货地址:</span>
                    <span id="receiverAddress"></span>
                </div>

                <div id="shippingDetail">
                    <h3>物流信息</h3>
                    <div class="info-row">
                        <span>物流公司:</span>
                        <span id="shippingCompany"></span>
                    </div>
                    <div class="info-row">
                        <span>物流单号:</span>
                        <span id="shippingNo"></span>
                    </div>
                </div>

                <div id="shippingForm" style="display: none;">
                    <div class="form-group">
                        <label for="shippingCompanyInput">物流公司</label>
                        <select id="shippingCompanyInput" class="form-control">
                            <!-- 选项将通过JavaScript动态添加 -->
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="shippingNoInput">物流单号</label>
                        <input type="text" id="shippingNoInput" class="form-control" readonly>
                    </div>
                    <button id="submitShipping" class="btn btn-primary">确认发货</button>
                </div>
            </div>

            <div class="order-items">
                <h2>商品清单</h2>
                <table>
                    <thead>
                    <tr>
                        <th>商品</th>
                        <th>单价</th>
                        <th>数量</th>
                        <th>小计</th>
                    </tr>
                    </thead>
                    <tbody id="itemList">
                    <!-- 商品列表将通过JS动态加载 -->

                    </tbody>
                </table>
            </div>

            <div class="order-actions">
                <button id="cancelOrderBtn" class="btn btn-danger">取消订单</button>
                <button id="completeOrderBtn" class="btn btn-success">标记完成</button>
            </div>
        </div>
    </div>
</div>

<script src="js/admin-order-detail.js"></script>
</body>
</html>